package com.czd.support.service;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.model.Record;

/**
 * @author Administrator
 *
 */
@Service
public class RecordService   extends  BaseService<Record>{
	 
	 public Paginate queryForPage(Record record , String kw) {
		 record.setWhere(" 1=1");
	        if(StringUtils.isNotBlank(kw)){
	        	record.setWhere(record.getWhere() + " and (name like '"+kw+"%' or phone like '"+kw+"%' or id like '"+kw+"%' or invite like '"+kw+"%')");
	        }
			return this.queryForPaginate(sqlId("queryForPage"), record);
		}
	 
	 public   Record   findById(int   id){
		   return   this.selectOne("findById", id);
		 
	 }
}
   